major update to views, refactored to avoid reduntand repetition of code