Refactor helper