refactor action update in post controller