avoid static variables

Change-Id: Ib73464cbd9ddc644b008ab7fdcab5ca70dcaa2f1
fix coding style

Change-Id: I4841929ac8f1a50892d72f7b2a32ba2f55b62a85