refactoring code, tests for deletion
tests for update action permissions