Do not capitalize keywords
More concise return statements

Remove unnecessary variable assignments
Remove redundant true/false assignment
Fix exception namespace
Use more explicit less-than check
Use consistent variable naming format