refactor + update and delete