refactored game file with methods