Made static so I can use it in mongo