Refactor specialCase() and handleStep()

This is to remove unnecessary duplicate variable being passed in.