Improve non-lazy rescr function with more intelligence.