Refactor learning and group controller