refactoring goto table