Simplify getusertypes() function