add support for collecting tags and processing queries