refactor js and align monitor