refactored PostHandler