tablesiwtch / refactoring