split passwordFn into separate module