Clean up function declarations and some unused functions

Change-Id: I2b743ee6e184af5f9020309ea5e184aa17c19405