Refactor status determination into helper function.