major refactoring, restructure functionality

* merge reset and cancel button functionality into discard button
* view enhancements
* simplifying javascript code