Refactoring tablerowselect plugin