cleanup

improvements for #354 and #356