basic tests, encrypted passwords & refactor