refractoring some inner dealing cases