most refactoring complete on commited files, organized and cleaned up