Simplify code, remove unnecessary checks, use isalnum()