Refactored the data-type converter into a library