More work on the refactor, still lots to go