Remove unused code in mongo object