streamline failure path in code