Re-organized code so it's easier to follow the flow