refactor severity functions