oapmc refactoring and fixes