Refactor check helper merthod.