Clean up function declarations and some unused functions

Change-Id: If2c233a8ced8815b065a72caff907f10ef6166ff