Refactor rerun to allow for Mac integration