do some refacting