visitor pattern for inputs/outputs