Add media, and clean up code