refactoring and updated controller and tests; added enum for game phase