Snake refactoring homework