Refactors roleenttest to use database utils