some refractoring