simplifing the code