Refactored converter into testable library.