Refactored uppercase SQL, import & export code