Refactored finishStep