more refactoring
Add database config template
Fix minor typo