remove deprecated calls and unused imports