Assignment 5: Refactoring Solution