At this point I think we should have one base class with the common logic and with 5 subclasses for each type supported.
That would simplify the code and make it more readable.
They can all be defined in the same file.