removed duplicate view code and other fixes