Those pellets may not be intended for bettas, or at least are not ideal. Bettas only eat food floating at the top, so it's important to clean out the pieces that sank our have gotten stuck to the filter. Otherwise they will break down and rot in the water, which will bring down the quality of the water, which is a fast track to a sick betta. Some bettas do like flakes, but usually pellets designed for bettas are better for them, don't sink, and don't make a mess in the water like flakes tend to do. There are so many types of pellets out there, and some are better than others, so I know it can be confusing trying to select just the right food for Mr. Betta! Many people here recommend Hikari brand betta pellets, but personally I have had wonderful success with ZooMed micro floating betta pellets (a very inexpensive option you can pick up at Petsmart). My extremely picky eater LOVES them, and they do seem to help make his colors vibrant. One type of pellet I would say to stay away from is Tetra brand betta pellets. They are very big and of very low quality. When in doubt, read the ingredients & avoid the pellets that are mostly "fillers." It is also a great idea to add a little variety to a betta's diet for many reasons, so you may want to consider occasionally giving him a bloodworm or some mysis shrimp as a treat. Most pet stores sell them in a freeze dried form, which (while not the freshest) is probably the most convenient option. It's best to soak them in a tiny bit of his tank water before feeding so they are "rehydrated" and won't swell in his belly after he eats. You are definitely making a smart choice switching to pellets if the flakes are making the water a mess! Give the pellets another shot, and try a different brand. Just be sure to select one that specifically says "betta pellets" or "for betta" and you'll get just what you need-- non-messy food that floats! :)
Good luck, and happy betta keeping!