make encode.core function private