clean up variable declarations and trim post content