updated dependencies and small refactoring