move runner code into separate file