code optimization/refractoring