Tidying up database entities