Moving timer logic into a class