Remove unused functions and updated some comments