add associations and refactor user model