some optimizations. also, split some things out into tox files