Some tweaks to improve performance