Move these database methods to new trait
Simplify some database calls