some refactoring performed.