more progress on the refactor