Using find_by instead of find, some indentations fixed and using else case for destroying comapnies and groups