Refactor to ease extending.