adding some refactoring