Refactoring

Creating an abstract class for documents comparator, an interface for key generator etc.