helper function/refactor for easy use