Refactor to clean up duplicate resources and vars

Change-Id: Idc53584c1f4c408dd6624d9feb2f32bf042f0b57