few changes, js optimization