Moving it into its own type to better organize and separate concerns. Also makes unit testing easier.