created more tests, did some refactoring