refactored the code, removed no longer relevant test files