Remove unused references and clean up file