Rename is_registered to is_user_registered
Reorder function definitions