move dispatch into ruby side