simplifying the code