refacor code for titles and added default values for title options