Minor refactoring. Unit tests for policy enforcement groups added.