Refactoring Pattern class