Improve get_db method in fab