Code was clean up and simplified to make it simpler and easier to maintain. No features were modified.