did some refactorings