Refactored the conversion calculations to use more functions
appropriately