a bit more refractoring