apply generic rstrip on output instead of case-by-case
fix import entrypoint