Refactor 2 encoding.rb week 4