Prince William leaves military to focus on royal work, charities