Fix build errors because of not included file.

Plus improve code layout.

Refs #7557