cleaning up before pushing/subtreeing