Moving some of the global variables as fields.