pointer added, some refactoring /  minor