Other refactor to encoding.rb