Refactoring js files

Let's jquery style
Optimize hata selectors