generatePostData functions