optimisations / refactorings