Partly revert "Minimize dependencies"

This reverts commit da0d069c2c508270fb3d47783d35deb81e369fef.