Refactored the codes and added password widgets.
Fixed template to safe rendering html.