fixes #3930 - refactoring of edit_self implementation.