Compositions and methods for treating bacteria