removed unused code/tests and refactored some parts, slightly