refactors times js