Cleaning up redundant code