Improving and clean up database access/reading