reset page reworked

- now works with empty data set
- moved some code to util.py