nearly complet refractoring