further code optimisations