Refactoring and cleanup on defaultroles implementation