major refactor to testing. all run in single file