improve performance for getting complex types