cleaner way of testing output