some performance optimisations