Factor InjectData code