More efficient generation of optimised code (I hope)