Improved Type value function