more improve type inference