Ceanup unused functions and improve function names