Improved maintenance

CHANGED:
 - main function optimized: functions and intervals are saved in vector
to make new (future) stats easier to add