Simplify set_titlebar function