more progress on refact