Use Config instead of globals

Change-Id: I57dc8b0b0a4067b1304a2fb3b8d480fbe1c34c12