Refactored timer problem