refactoring in data.h