More efficient way of setting titles