Refactoring BaseHandler