break table creation into own method