reading binary tables with cleaner implementation