mass refactor ... in progress