minor additions and optimisations