extract out timer and add more logging