Speed-up of functions