add in checks for email verified, type and refactor to make easier to read