moving QueryType, QuerySpec and TableSpec to the __init__