big refactor continues