Confine server, stream, and storage logic to the relevant src files. Create abstract interfaces between functionalities.