Refactored complexity for createTable method