I finally did major updates and corrections to the create post function.
Categories creation was my nightmare but I finally manage to code it cleanly. Getting back to my ugly code and fixing it, required me some time. It was a challenging one but it worth the effort.
I now try to follow WP coding rules and recommendations as much as I can.
Thanks to my new book