some refactoring and finished edit task functionality