Rework into common structure

Change-Id: I42c00c2a3d60a1c67f965cb3b2aa0f3fe1f36b07