Remove unused code from libraries