simplifiying the code