Second refactor encoding.rb week 4