Remove handwritten inner joins