moved internal stuff to internal.h
moved internal stuff to internal.h