Simple code refactoring