end of big refactor to bring order to the chaos