Refactor debmon support