Remove debug message
Simplify exception handling
Flatten data structures before inserting into db