refactoed view tests