Issue #2653410 by heykarthikwithu: Replace deprecated usage of EntityManagerInterface and remove unused imports in code base