simplify edit context and some fixes