fix RefDataManager and add firts working test on it