before refactor portstat