limits principals returned by the autocompleter to only active or registerd
cleaning up unused code, rewriting scopes