Refactored view related stuff