Changed some utility function