[IMP] Improve timer, Improve js code