Refactor role system