Refactored output test