getting ready to change database structure and fix memory issues