Moved post logic to post file