cleanup: unused code removal

unused/redeclared functions are removed.