Fixed capitalization issues and got rid of some magic numbers