code refactoring of helpers