make js code some better