refactor - extract table metadata class