add docblock
clean javascript code