Optimize GetBaseData code