Swapinfo: refactor and simplify

Change-Id: I92ed67ac8393255267dd2b0ae5a00acd9b4aad90