Http handler refactor