Move utility functions into root package