Try to reduce complexity of operation to get some speedup

Just and idea. It might be worth to reuse how danger_values is build