refactor for handler controller