Code tidy up and renames.