applied missing 2.5 changes to 3.0 + cleanup