Some performance tweaks

Change-Id: I10b8b25c2cc3629b79ee2ff12e5758c226d668b2