Make class more testable
Improve tests and coverage
Clean up after test run