Group some interfaces together to prepare for changes.

This commit only moves lines of code together. The result should be the
same code but grouped differently to make changes in further commits
more clear.