refactor game rules