Tidy up by removing unnecessary local variables