Refactor game and sliding_piece code