Refactor b/c check - thanks @mbabker