clean up loader code to represent what was used to create database