Fix typo and make code more clear