Refactor Handler for abtest & Bug fix