refactor game module