refactor post