More refactoring, extracted a new utils