code cleanup; tables and foreign keys are renamed