refactoring and more role support