Got rid of forward declarations with better code layout

Change-Id: If2ea2786f4e1274921abbd7aa1f74f39f0440a06