code cleanup and consolidation
last bits of code cleanup (I hope)
Merge branch 'code-cleanup'

* code-cleanup:
  last bits of code cleanup (I hope)
  code cleanup and consolidation