updated core class to use dependency injection