refactoring database code
more refactoring
more database refactoring
more database refactoring