Simplify checkUsername() and checkClientId() from redundancy type check.