procedure -> class refactor