helper refactor