unrefactored runlog code