refactored a bunch, allowing to specify (using factories) any type of objects for keys and values in cache
updating class hierarchy for better key/value management