Clean up Input code.