To avoid using global variables.
https://bugzilla.gnome.org/show_bug.cgi?id=691132
https://bugzilla.gnome.org/show_bug.cgi?id=677206