Sorry been to busy to check.
Now way would be to create separate functions for each page but add the screen clean block to the beginning of the function loop.