updated to use new objects and consolidated