Cleaned up type resolution and virtual types