further improvements for #242