Removed a load of redundant code