Refactor the step definitions