refactoring Database tables