DRY up the database plugins
Fix indentation