Assignment 2 Refactor