Remove unused legacy code