refactor table activation to be more readable