refactored : created method setOutput