Snake refactoring