Style and readability refactoring