cleaned views code