move foreignSchema upstream
simplify unsafe data class