Moved database initialisation into the init() method.