Refactor js style