Takes Database pointer