Minor changes to use less variables for previous fix