Implement ioc by constructor