added more tests, minor refactorings