refactoring: compare method
small chages