main and metadata