Got edit feature working with input tag but needs major refactoring to follow D.R.Y