before refactoring in preparation for mongodb