Adaptive constructor