Clean up code and make delete the convention for functions that free structs