Working with views from code