Lots of stuff, breaking apart into separate files