refactoring database.yml, mail.yml, and *.env files