big refactor underway