Updated and removed some utility functions.