Refactored code for blog categories creation.