Refactor user database