had to refactor few functions here and there. Change-Id: I86fde6fec7c2fc7eb48f0ecf327dbbd2bd40b9d4
Change-Id: Ia5eb5496e4337e5bac8203872c5b014cad21c4f9