Replaced three function calls with one.