fix rules to find class, interface and trait definitions, codestyle fixes