Clean mongo check code