Replacing the output variables with objects