strongly refactored MSP with callback support