Move utility functions at the bottom of the file