Refactoring, updated createUser with generating SHA256 password hash