Refactored to use arc structs