created abstraction for formatting output