writing metadata moved to base generator