[Lib] Move response switch logic to separate method