cleanup and refactroings

lots of classes out-sourced to archimedesj