Variable name tidy up and optimisations