adding the helper and some refactoring