restructured for easy add in to a new project