made the code more concise