added various optimisations