Revert "Some build optimizations"

This reverts commit ebf85a66d23ff6717690c846d31d1b9febb95045.