refactoring timing scripts