Refactor sequence logic into application helper method