i made some refactorings.