starts refactoring of error handling in view functions (try to have dumbest views)