Move run_* functions to separate file