Updated some utility functions