Better type resolution