further optimisations/tidy