Tidy up code after merging command line client