split client side code, added title refresh