Move clean up function to editutils