refactor the method cache objects to have a superclass