Moved out non-util functions from util module.