moved creating table to new method