Moved danger code into separate class