move printing into its own class