[PATCH 3/4] Restructure output format computation for better expandability