code cleanup and minor bugfixes and extra filters for SPIN interaction [ as of corporate c9e054d1df9a1f1cb5970d488d379eb3a7350035 ]