Use local variable instead of chained method call