Refactor some of the top-level a little