refactoring: creation of functions for tables with selectable elements