Refactoring for more readable code