minor refractoring
minr refrac