Refactor Service Gateway Handler spec