created unit tests and refatored Visibility