shared lib implementation