code refactoring and underscore