Refactored, mainly to removed duplicate logic among the states.