(refactor): isLastStep and isFirstStep