some refactorings..