Refactoring and making the post actually work