implemented timer service and refactored background worker