Save edited data item. Refactor code. Small changes to GUI