Move include to the function where used. Closes #3219