Adding element constructor for widgets