Restructure to add tests