Extract an expression at the caret as a variable by pressing or navigate to Refactor | Extract | Variable. Also, you can select whether you want to replace all the occurrences of the expression in other places within a function.