Tidy up redundant code