Refactored to class-based style