move tags/attributes transormations to Middleware class