lots of setup stuff that should have been divided into more commits