make view detection neater
as per ellgrey's suggestion