Remove unused code and cleanup.