Moved utility functions