refactoring demandspike