changed from each method to inject