small refactor for helper