improvements on widget boilerplate