Done some refacture.