Refactor hnruby.rb into three files