Better type inference