Extract subexpressions as variables for code readability