refactored table definitions