Updated for Mattamy optimizations