del unused files, major refactoring, 90% test coverage