refactor switchTimer