Clean and fast implementation of readtable