Remove useless code + changing type of flashmessage for error + updating rules for badge is good