Made code more simple