[Refactor] Remove code duplitcation
[Refactor] Smaller methods are recommended
[Refactor] Fix English: a -> an