Refactoring for better style