refactoring, making post work