Add helper function and remove redundancies. Original patch by https://github.com/rspeed
Add helper function and remove redundancies. Original patch by https://github.com/rspeed

oittaa/acme-tiny,oittaa/acme-tiny