Stages 1 & 2 refactored.