Refactor: Override equals and hashcode, test cases more readable now