did some refactory.