Further work on refactoring and SPAifying the edit page