Updated dependencies and minor refactor