updated packages, tests, some refactoring