refactor: moved util fns to namespace