refactor: Move functions from global to utils file