close #4

refactor clone method and fix js style