More Mako optimizations (Credits to Vanir)