Refactoring for better understandability