extract notify with rescue
extract purpose helpers
simplify remove_line