a bit of refactoring on nagios stats view