refactoring utils