Refactor game