A lightweight hookable factory providing control over object instantiation