Code clean up, removing code dublicates