Create internal function