Moved method from util to dbmanager