Possibly consider using the visibility_api module which is essentially what you have to choose visibility but abstracted into a seperate module and is used for other modules as well.