remove all this crap
actually make this testable
return an enumerator if no block is given like a good ruby citizen
pull this crap out into two separate files