cached types + small refactoring //