Cleaning up obsolete functions and tests