Added a function to be used in views