Refactoring for consistency and readability