[#544] couple of optimization to lower the creation of temporary variables