Refactor around reading file
Use counter instead of counter_collection
Remove require 'thread'
Implement filter