CM: cleanup a bit more. still needs refactoring