consolidating some login codeand removing the old haml codes from views