refactor handler and group var