move impl to library and add namespace