Tweaks to rearrange some functionality.