major refactor to create test mode