Mako optimizations

Change-Id: I817af6845cb54bb52a79f9d54bee91c9c557dea8