[FastCgi] Improving type safety