Refactor split up widget initialization