-code cleanup and legibliity improvements in hopes of getting this back
to a managable size
- some modularity improvements