Create a function for determining the identity type to follow DRY best practices.