work in progress
reorganizing things around
some cleanup and tests
update test