refactor handler<S,X,CTX> => handler<T>