refactored most of the puts statements