refactoring export run and setup