reduce memory usage
clarify logic
resample always if no threshold given
fix group name
remove unused headers
fix missing header