Minor improvements to js widgets factory methods