refactoring epsiclock.js