Refactor snake.