Make part of code correct and readable, add begining and ending elements for views