Move password function into own class