Made the code a bit more concise