Adds the spinner to the actionbar and restructures some code