improve type inference