Separate common function will be great for this conversion.