More minor changes and code tidy up