Moved the DB actions to a separate modules.