Moving utility functions into util module.