Refactoring theme to pull out Apollo functionality into plugin