cleanup the hide rows function - easier to read and manage