updating views and some logic