Refactor the inputs and outputs