Extract code for determining constructor type