refactor and start on auth, will need non-blocking read