refactor table class