Extensive tidying - removing comms parameters and code.