Use Config instead of globals

Change-Id: If6eac180316ef626e319fbd39988259dfcaffe16