making the function little clean