Tidied up the is_enabled and is_visable functions.