refactoring for short coding