small code refactoring