last class refactor