More progress in refactor