table input refactoring