Cleaned up a utility function