Refactors joists in left menu db call