Refactor list_to_pointer, mm_to_pointer, and etc.