refactoring of help functions