functions in views