Refactoring the black/white list functions.