refactor: put BaseHandler in separate module