javascript code improvements
new ui