Restructure and format import functionality