extracted some timer related code to a module