refact the clock.js