Update dependencies and cleanup code