refactor user-io