Implemented edit form and did some cleaning up