change type inference method (now stable) and refactor code