mongodb tests code cleanup