Simplified the SQL code of a view
Added new getter functions in the DB