Move the tag reading to an external lib