Implements factory for container