Moved out conversion logic