Remove unused code and associated tests