simple code refactoring