little code refactoring