Clean up function declarations and some unused functions

Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645