rewrite S3 methods and update R docs