`select` related code moved outside of table module