refractoring, use classes