Refactor table def