Improved security and optimisation