Generic table refactoring