removing multiple check conditions to single check condition