Refactor == method