Changed TableName to readonly property

Also moved detection to extension method.