major rewrite, basically move all fine tuning out to files