extractToWaste now tracks state + some minor performance tweaks