refact to use structs for process output storage