Unify LambdaEdit and PiEdit into LamEdit
Extract common code in LamEdit