Cleanup deprecated calls and unused imports.