now enforcing setting app on top level groups. rewrote some test cases.