code restructure and optimisation