Refactors Mongoldb to get joists