add test for multiple outputs
reduce method complexity