adding some refactorings