Separate each implementation (3 as of this writing) into each own "handler" class. This should make the code easier to understand, maintain and extend.