Refactored equals method 

Reduced in hopes of reducing cyclomatic complexity