refactors timer class