some refactoring, stuck on compare