Refactor of main.rb, break apart each chunk of output