Some refactoring (mostly to clean up component dependencies).