Simplify code by reusing common parts. Still need to do the same for the new action.