Updated prepare module to use new database module