Refactored class resolving to reduce number of resource lookups.