minor refractoring

no way near ready