Extract helper function to fail