Split up getUrlVariables method