extract some method from handlers