refactored definition type resolving