remove unused dependencies and fix the required compat APIs