Moved to utils package and minor changes.