More work on big refactor.