wip refactor to uniform output/input invocation