Moving structs to outer package to avoid more cyclic dependencies.