Added @crazysam optimizations to avoid unnecessary allocations (except for the BMD cache)