more data structure optimisations