DRYd up form and added edit action