clean up code with partition tables