major refactoring
cleanup