minor improvements, renaming, tidy up