Refactoring to make loading routes simpler. Need to reconsider the way that the spinner is being implemented.