use instance method db instead of constant in calculator.rb