Move configuration logic into a class