refactor: extracted util methods