Refactor units and conversions