refactor game for easier interfacing