Clean up function declarations and some unused functions

Change-Id: I382289c7188dfdc9839ff9e6362b6e039ffc5f9e