lemmings refactoring