extract logic to a protocol, now we can plug-in more functionality over time, think unix pipes

Signed-off-by: Andre Dublin <81dublin@gmail.com>