refacoring type detection