added struct to clean up code