refactor specialty.rb