some speed improvements

(done with Jules&Rasmus)