pass dependency in constructor call instead of method call