organized js
improved helper funcionality