refactor timer (what did I think?)