refactoring for moar modularity...
mega refactoring done.
Merge branch 'refactor'