code review/refactoring

here are some suggestions to improve code comprehension and maintenance.  please take with grain of salt and grab me sometime to discuss.  (these changes are untested--more for just personal feedback for future reference and discussion).   thanks, JH