create db table generator program and refactoring