bottle: Fix hardcoded db host and refactoring.