refactoring slabs.c and slabs.h