move tag reading where it belongs