refactoring in utils