Split run into multiple functions