better handling of optimisation