Simplifying the code