I'd probably make this a shortcircuit but maybe that's just me: start with `return "#{host ? 'localhost'}/#{db ? 'test'}" unless db and '/' in db`