use generated method to define handlers