refactored run