mins seconds prediction and refactoring js :koala::herb: