change Allocate static and change unit tests accordingly