moved run logic to Program class