Extrated read-util and added tests