refactor the table class and add the interaction class