Apply refactoring
Add hashCode and equals