refactor posts