more refractoring

more refractoring, cleaning