making the code neater