Refactored Timer class