use same markup for create and edit, also fixed some bugs and optimized JS code