refactor to split control out to a Framework class