change implementation of the saveLoadHandler to use generic types