Clean up & structure title editing code