Some tweaks for optimization