Fixed if statement issues. Improved code redability. Added safety message consumer