Use dependency injection instead of static state