big refactor started