src: more refractoring