core: fix missing imports for anonymous classes
fix some code style issues
core: fix generic types for local variables